data<-read.table("result_geneblock.txt",sep="\t")
data<-na.omit(data)
k<-"k"
t<-1
occur<-c()
ar<-c()
while(t<4)
#while(t<nrow(data)+1)
{
	#print(data[t,1])
	if(k != data[t,1] && k != "k")
	{	
		
		ar<-sort(ar)
		#occur<-c(occur,rle(ar)$lengths)
		#print(ar)
		countar<-rle(ar)$lengths
		if(length(occur) ==0)
		{
			occur<-countar
		}
		if(length(occur) >0)
		{
			if(length(occur) == length(countar))
			{
				occur<-occur+countar
			}
			if(length(occur) > length(countar))
			{
				 c<-occur[1:length(countar)]+countar[1:length(countar)]
			 	occur<-c(c,occur[(length(countar)+1):length(occur)])
			}
			if(length(occur) < length(countar))
			{
				c<-occur[1:length(occur)]+countar[1:length(occur)]
			 	occur<-c(c,countar[(length(occur)+1):length(countar)])
			}
		}

		ar<-c()	
		ar<-c(ar,data[t,3])					
	}
	else
	{
		ar<-c(ar,data[t,3])
		#print(data[t,3])
		
	}
	k<-data[t,1]
	t<-t+1
}
print(occur)
